package com.tom.imooc.mybatisplusdatasource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Tim
 * @Description:
 * @Version 1.0
 */
//@DS("test_order")
@Service
public class MybatisOrderServiceImpl implements MybatisOrderService{
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void addOrder(String name) {
        jdbcTemplate.update("insert into `order`(name) values(?)" ,name);
    }

    @Override
    public List queryList() {
        return jdbcTemplate.queryForList("select * from `order`");
    }
}
